
##-----------------------------------------------##
##  Check for FY05 Survey     
##-----------------------------------------------##

$stmt = $dbh->prepare("
BEGIN OPEN :cursor FOR
select distinct a_uid_c
     , f_sec1_i
     , f_sec2_i
     , f_sec3_i
     , f_sec4_i
     , f_sec5_i
     , f_sec6_i
     , f_stat_c
     , a_mgruid_c        
     , a_mgrbadge_n      
     , a_mgruid_x        
     , a_lvl3uid_c       
     , a_lvl3badge_n     
     , a_lvl3uid_x       
     , f_prof_c
  from corpfin_dbo.t_fy06_fycctr   
 where f_fy      = :fy  
   and f_loc_c   = :loc 
   and f_dpt_c   = :dpt 
  ;
END;
     ") or DBI::errstr;


$stmt->bind_param(":fy",    $input{'FY'});
$stmt->bind_param(":loc",   substr($input{'CCTR'},0,2));
$stmt->bind_param(":dpt",   substr($input{'CCTR'},2,4));
$stmt->bind_param_inout(":cursor", \$sth2, 0, { ora_type => ORA_RSET } );
$stmt->execute;

$i=0;
while ( @data = $sth2->fetchrow_array() ) {

 $i++ ;

   }

$stmt->finish;



if ($i eq 0) {
print <<ENDOFFILE;
<BR> $F0 No Survey Data is Available for FY05.
ENDOFFILE

exit;
   }
